package com.czk.yygh.order.receiver;

import com.czk.common.rabbit.constant.RabbitConstant;
import com.czk.yygh.order.service.OrderService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 接收定时任务提醒
 *
 * @Author:ChenZhangKun
 * @Date: 2021/12/1 22:15
 */
@Component
@RabbitListener(queues = RabbitConstant.QUEUE_TASK_8)
@Slf4j
public class OrderReceiver {
    @Autowired
    private OrderService orderService;
    @RabbitHandler
    public void receiveMessage(String msg) {
        log.info("【收到提醒就医的定时任务{}】",msg);
        orderService.patientTips();
    }
}
